import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'
import Login from '@/views/Login.vue'
import Good from '@/views/subviews/Good.vue'
import Access from '@/views/subviews/Access.vue'
import Order from '@/views/subviews/Order.vue'
import System from '@/views/subviews/System.vue'
import Dept from '@/views/subviews/Dept.vue'
import DeptDetail from '@/views/subviews/DeptDetail.vue'
const routes = [
    {
        path: "/",
        redirect: "/login"
    },
    {
        path: "/home",
        redirect: "/home/dept",
        component: Home,
        children: [
            {
                path: 'dept',
                component: Dept,
            },
            {
                path: 'access',
                component: Access
            },
            {
                path: 'good',
                component: Good
            },
            {
                path: 'order',
                component: Order
            },
            {
                path: 'system',
                component: System
            },
            {
                path: "deptuserdatil/:id",
                component: DeptDetail
            },
        ]
    },
    {
        path: "/login",
        component: Login
    },
    

]
const router = createRouter({
    history: createWebHistory(),
    routes,
})
export default router